@echo on

rem fetch configuration values
call "%~sdp0..\..\Configuration\Configuration.bat"

rem replace content
%WINDIR%\system32\cscript.exe //B "%WSCRIPTXMLSETTEXTFILE%" "%PROJECTFILE%" "/Project/PropertyGroup/TargetFrameworkVersion" "v3.5"
if %ERRORLEVEL% NEQ 0 goto END

rem replace content
%WINDIR%\system32\cscript.exe //B "%WSCRIPTXMLREMOVENODEFILE%" "%PROJECTFILE%" "/Project/PropertyGroup/TargetFrameworkVersion/TargetFrameworkProfile"
if %ERRORLEVEL% NEQ 0 goto END

rem jump over the error code
goto END

:ERROREND

rem the error level needs to be set
set ERRORLEVEL=1

:END

rem record the exit code
set EXITCODE=%ERRORLEVEL%

rem should the script pause or continue
if "%1"=="BATCH" exit %EXITCODE%

rem wait for a response then exit
pause